/*
 * Triangle2D.h
 *
 *  Created on: 31.1.2013
 *      Author: Travis
 *
 *      This structure is store 3 points of triangle in 2D space
 */

#pragma once

#ifdef _WIN32 
#include <windows.h> 
#endif

#include <glm/glm.hpp>
#include <glm/gtc/matrix_inverse.hpp>

namespace DataTypes
{

class Triangle2D
{
public:
	Triangle2D(glm::vec2 a, glm::vec2 b, glm::vec2 c);
	Triangle2D();
	virtual ~Triangle2D();

	// check collision triangle - point in 2D
	// Point X vec2 type
	// return TRUE when collision is detected
	//
	// Using Barycentric Technique
	// http://www.blackpawn.com/texts/pointinpoly/default.html
	bool pointInTriangle2D(glm::vec2 X);

	//get
	glm::vec2 getA();
	glm::vec2 getB();
	glm::vec2 getC();

	//set
	void setA(glm::vec2 a);
	void setB(glm::vec2 b);
	void setC(glm::vec2 c);

private:
	glm::vec2 A, B, C;
};

}
